package IC.AST.nodes;

import IC.AST.*;

/**
 * a new array expression
 */
public class NewArrayExpr extends Expression {
	private Type elemType;	// the type of array elements
	private Expression size;	// the array size specifier

	/**
	 * @param elemType the type of array elements
	 * @param size the array size specifier
	 * @param line the node line number
	 * @param column the node column number
	 */
	public NewArrayExpr(Type elemType, Expression size, int line, int column) {
		super(line,column);
		this.elemType = elemType;
		this.size = size;
	}

	/**
	 * @return the type of array elements
	 */
	public Type getElemType() {
		return this.elemType;
	}

	/**
	 * @return the array size specifier
	 */
	public Expression getSize() {
		return this.size;
	}

	public Object accept(Visitor v) {
		return v.visit(this);
	}
}
